import request from '../request'

//获取所有用户
export const GetUser = (queryDTO) => request.post('/user/list',
{
    pageNo:queryDTO.pageNo,
    pageSize:queryDTO.pageSize,
    keyword:"%"+queryDTO.keyword+"%"
});

//修改用户状态
export const AlterUserState = (userlist) => 
    request.post('/user/updateState',
    {
        uid:userlist.uid,
        state:userlist.state
    });

//修改邮箱状态
export const AlterMailState = (userlist) => 
request.post('/user/updateState',
{
    uid:userlist.uid,
    verified:userlist.verified
});

//添加用户
export const AddUser = (addForm) => request.post('/user/add',addForm);

//删除用户
export const DeleteUser = (userlist) => request.post('/user/del',{uid:userlist.uid});

//更改用户信息
export const EditUser = (addForm) => 
request.post('/user/updateState',
{
    uid:addForm.uid,
    username:addForm.username,
    email:addForm.email,
    nickname:addForm.nickname,
    password:addForm.password,
    exp:addForm.exp,//经验
    sign:addForm.sign,//个性签名
    gender:addForm.gender,//性别
    credit:addForm.credit,//信用值
    province:addForm.province,
    city:addForm.city,
});

//批量删除用户
export const MdeleteUser = (list) => request.post('/user/mdel',{uid:list});


//重置密码
export const Resetpwd = (userlist) => request.put('/user/reset',{uid:userlist.uid});